package tmi.li.testapp;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.SurfaceView;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Configuration extends Activity {
	
	
	private Paint mPaint;
	public LayoutEditor editor;

 	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPaint = new Paint();
        mPaint.setDither(true);
        mPaint.setColor(0xFFFFFF00);
        mPaint.setStyle(Paint.Style.STROKE);
        mPaint.setStrokeJoin(Paint.Join.ROUND);
        mPaint.setStrokeCap(Paint.Cap.ROUND);
        mPaint.setStrokeWidth(3);
        setContentView(R.layout.main);
        
        editor = (LayoutEditor)findViewById(R.id.LayoutEditor01);
        Button button = (Button)findViewById(R.id.Button01);
        button.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				// TODO Auto-generated method stub
				editor.addElement();
			}
        	
        });
        // The activity is being created.
    }
    @Override
    protected void onStart() {
        super.onStart();

        // The activity is about to become visible.
    }
    @Override
    protected void onResume() {
        super.onResume();
        // The activity has become visible (it is now "resumed").
    }
    @Override
    protected void onPause() {
        super.onPause();
        // Another activity is taking focus (this activity is about to be "paused").
    }
    @Override
    protected void onStop() {
        super.onStop();
        // The activity is no longer visible (it is now "stopped")
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        // The activity is about to be destroyed.
    }
    
    
    public void testWidget(Context context) {
        Widget widget = new Widget(context);
        widget._id = 10;
        widget._flcolor = "#FF363636";
        widget._ftcolor = "#FF000000";
        widget._fbcolor = "#FFFFFFFF";
        widget._bcolor = "#55000000";
        widget.save();
        widget.logWidget();
        widget._current = "10";
        widget._desc ="MOSTLY";
        widget._desc2 = "CLDY";
        widget.update();
        widget.logWidget();
        
        widget = null;
        widget = new Widget(context);
        widget.load(10);
        widget._current = "5";
        widget._desc = "snow";
        widget._desc2 = "";
        widget.logWidget();
    }
    
   


}